package team.damo.admin.dao.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.github.yulichang.query.MPJLambdaQueryWrapper;
//import com.github.yulichang.query.MPJQueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import team.damo.admin.dao.TestDAO;
import team.damo.admin.mapper.TestMapper;
import team.damo.admin.model.Test;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: ZhangHeng
 * @Description: TODO
 * @DateTime: 2024/2/18 下午2:50
 **/
@Repository
public class TestDAOImpl implements TestDAO {
    @Autowired
    private TestMapper testMapper;

    @Override
    public List<Test> getList() {
//        ArrayList<Test> testArrayList = new ArrayList<>();
//        testArrayList.add(new Test("zhangsan","12341"));
//        testArrayList.add(new Test("zhangsan2","12342"));
//        return testArrayList;
//        testMapper.selectJoinList(Test.class,new MPJQueryWrapper<Test>().lambda()
//                .selectAll(Test.class)
//                .eq(Test::getUsername,"username")
//                .groupBy(Test::getUsername));
        return testMapper.selectList(new QueryWrapper<Test>().lambda()
                .eq(Test::getUsername,"username")
                .eq(Test::getPassword,"123456"));
    }

    @Override
    public List<Test> getListById(int i) {
        return testMapper.getListById(i);
    }
}
